<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>事件绑定</title>
	</head>
	<body>
		<button id="btn1" value="1" type="button">点击</button><br>
		<button value="2" onclick="on(this)" type="button">点击</button><br>
		
		
	</body>
	<script type="text/javascript">
		function on(obj){
			alert("我被点击了." + obj.value)
		}
		document.getElementById("btn1").onclick = function(){
			alert("[getElementById]我被点击了." + this.value)
		}
		
		
	</script>
</html>